<?php

defined('_JEXEC') or die('Restricted access');
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');

class  ConsoleModelchannel  extends JModelList
{
    public function selectAll() {
        $db = $this->getDbo();
        $query = $db->getQuery(true);
        $query->select('*')->from('pp_channel_cfg')->order('name');
        $db->setQuery($query);
        $items = $db->loadObjectList();

        return $items;
    }

    public function getItem($id = null)
    {
        $db = $this->getDbo();
        $query = $db->getQuery(true);
        $query->select('*')
            ->from('pp_channel_cfg')->where('id='.$id);
        $db->setQuery($query);
        $Item= $db->loadObject();
        return $Item;
    }
}